
cd U:\TQS\Monarch\JMP\restat

clear

global fig_data "U:/TQS/Monarch/JMP/restat/fourth_round/files_for_conditional_acc/replication_package/figure_data"

*import excel using $fig_data/Tab_II_3_stay_share_plots.xlsx, first
import excel using $fig_data/stay_share_plots.xlsx, first

cd $fig_data

label var hs2_z1 "HS2 Contract Intensity"
label var hs2_cap_intensity "HS2 Capital Intensity"
label var hs2_skill_intensity "HS2 Skill Intensity"
label var rel_weighted_hs2_stay "Weighted Stay Share"

local xlist hs2_z1 hs2_cap_intensity hs2_skill_intensity

foreach x in `xlist' {

twoway (scatter rel_weighted_hs2_stay `x', mlabel(hs2) msymbol(i)) (lfit rel_weighted_hs2_stay `x'), legend(off) ///
ytitle("Weighted Stay Share") scheme(s2mono)  graphregion(color(white)) saving($fig_data/`x'_rel_weighted_hs2_stay, replace)
graph export $fig_data/`x'_rel_weighted_hs2_stay.pdf, as(pdf) replace
erase $fig_data/`x'_rel_weighted_hs2_stay.gph

}

use $fig_data/figure2_data, clear

twoway (scatter stayrate beta_x) (lfit stayrate beta_x), scheme(s2mono) legend(off) ///
ytitle("Stay Rate")  graphregion(color(white)) saving($fig_data/beta_x_graph, replace)
graph export $fig_data/beta_x_graph.pdf, as(pdf) replace
erase $fig_data/beta_x_graph.gph

twoway (scatter citystayrate beta_c) (lfit citystayrate beta_c), scheme(s2mono) legend(off) ///
ytitle("City Stay Rate")  graphregion(color(white)) saving($fig_data/beta_c_graph, replace)
graph export $fig_data/beta_c_graph.pdf, as(pdf) replace
erase $fig_data/beta_c_graph.gph
